from socket import *
import time
ip_port = ("localhost", 1234)
tcp_clent = socket(AF_INET,SOCK_STREAM)
tcp_clent.connect(ip_port)
print("链接。。。。。。")
while True:
    msg = input("请输入字符串：>>>").strip()
    if not msg:continue
    tcp_clent.send(msg.encode("utf-8"))
    print(msg.encode("utf-8"))
    time.sleep(2)
    data=tcp_clent.recv(1024)
    print("server send message is :",data.decode("utf8"))
tcp_clent.close()
